package net.crowdloud.client.user;

import java.util.List;

import net.crowdloud.client.groups.ButtonGroupCrowdLoud;
import net.crowdloud.shared.entities.User;
import net.crowdloud.shared.utilities.HomeIcon;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * 
 * @Feature
 */
public class UsersListPage extends VerticalPanel {

	public UsersListPage(List<User> users, String group) {

		VerticalPanel vp = new VerticalPanel();
		vp.setSize("97%", "100%");

		vp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

		HorizontalPanel hp = new HorizontalPanel();

		hp.setSpacing(5);

		hp.setWidth("600px");

		hp.add(new ButtonGroupCrowdLoud(group));

		hp.add(new HomeIcon());

		vp.add(hp);

		vp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

		VerticalPanel vp1 = new VerticalPanel();
		vp1.setSize("100%", "100%");
		vp1.setSpacing(10);

		vp1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		HTML html = new HTML("<br><br><br><b><font color='blue' size='3'>"
				+ group + " Users</font></b>");
		vp1.add(html);

		vp1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
		vp1.add(new ButtonNewUser());

		vp1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		vp1.add(new UserList(users));

		vp.add(vp1);

		this.add(vp);

	}
}
